package javacode.chapter05;

public class Example5_4 {
    public static void main(String[] args) {
        // 逆序输出字符串 “you are the best”
        String str = "you are the best";
        char[] chars = str.toCharArray();
        char[] arr = new char[chars.length];

        for (int i = 0; i < arr.length; i++) {
            arr[i] = chars[chars.length - 1 - i];
        }

        String strTarget = new String(arr);
        System.out.println(strTarget);
    }
}
